package generic;

import java.util.ArrayList;
import java.util.Collection;

public class PersonTest {

    public static void main(String[] args) {


        XingZhuang<Person> x = new XingZhuang<>();
        x.add(new Person());
        x.add(new Student());

        // Person不等于Student
        Collection<Student> collection = new ArrayList<>();

        x.addAll(collection);


    }



}

class XingZhuang<E> {

    public  void add(E e) {

        System.out.println(e);
    }

    public void addAll(Collection<? extends E> list) {

        System.out.println(list);
    }
}

class Person {

}
class Student extends Person {

}